<!--

<%--
  Created by Tony
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
	<title>ProjectBox</title>
</head>
<body>
<style type="text/css">
	.HL {background: #ffff00; color: #000000;}
</style>
<b>Hello!! ${user.firstName}, ${user.lastName}</b>&nbsp;&nbsp;&nbsp;<a href="<c:url value='/logout' />">Log out</a><br/>
<table width="1000" border="1" cellspacing="2" cellpadding="10">
	<tr>
		<td width="250"><center><a href="<c:url value='/announcement'/>">Annoucement</a></center></td>
		<td width="250"><center><a href="<c:url value='/myproject'/>">Project</a></center></td>
		<td width="250"><center><a href="<c:url value='/search'/>">Search</a></center></td>
		<td width="250"><center><a href="<c:url value='/rule'/>">Rule</a></center></td>
	</tr>
	<tr>
		<td>
			<p><a href="<c:url value='/newproject' />">New Project</a></p>
      		<p><a href="<c:url value='/myproject' />"><font class="HL">My Project</font></a></p>
      		<p><a href="<c:url value='/contribute' />">Contribute Project</a></p>
    		<p><a href="<c:url value='/project' />">Other Project</a></p>	
		</td>
		<td colspan="3">
			<h1>${project.name}</h1>
			<hr/>
			
			<h2>Contributors</h2>
			<hr/>
			<c:choose>
            <c:when test="${contributors != null}">
            	<table border="1" cellspacing="2" cellpadding="10">
                <c:forEach var="contributor" items="${contributors}" varStatus="counter">
                    <tr>
                        <td>${contributor.firstName} ${contributor.lastName}</td>
                        <td>${contributor.username}</td>
                        <td><a href="<c:url value='/myproject/${project.id}/${contributor.id}' />">View Resource</a></td>
                        <td><a href="<c:url value='/myproject/${project.id}/delete?contributor=${contributor.id}' />" >Remove</a>
                        </td>
                    </tr>
                </c:forEach>
                </table>
            </c:when>
        	</c:choose>
        	
        	<br>
        	
        	<h2>Pending Contributors</h2>
        	<hr/>
        	<c:choose>
            <c:when test="${others != null}">
            	<table border="1" cellspacing="2" cellpadding="10">
                <c:forEach var="other" items="${others}" varStatus="counter">
                    <tr>
                        <td>${other.firstName} ${other.lastName}</td>
                        <td>${other.username}</td>
                        <td><a href="<c:url value='/myproject/${project.id}/accept?uid=${other.id}' />">Accept</a></td>
                        <td><a href="<c:url value='/myproject/${project.id}/reject?uid=${other.id}' />" >Reject</a>
                        </td>
                    </tr>
                </c:forEach>
                </table>
            </c:when>
        	</c:choose>
        	
		</td>
	</tr>
</table>
</body>
</html>
-->
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="cs" />
<meta name="robots" content="all,follow" />

<title>ProjectBox</title>
<meta name="description" content="..." />
<meta name="keywords" content="..." />

<link rel="stylesheet" media="screen,projection" type="text/css" href="<c:url value='/css/mainForOtherPages.css'/>" />
<link rel="stylesheet" media="print" type="text/css" href="<c:url value='/css/print.css'/>" />
<link rel="stylesheet" media="aural" type="text/css" href="<c:url value='/css/aural.css'/>" />
<link rel="stylesheet" type="text/css" href="<c:url value='/css/button.css' />" />
<link rel="stylesheet" type="text/css" href="<c:url value='/css/viewresource.css"'/>"/>
<link rel="stylesheet" type="text/css" href="<c:url value='/css/jquery.qtip.css' />" />

<script type="text/javascript" src="<c:url value='/js/userResourceList.js' />"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.9.0/build/json/json-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.9.0/build/connection/connection-min.js"></script>
<script type="text/javascript" src="<c:url value='/js/jquery.qtip.js' />"></script>
<script type="text/javascript" src="<c:url value='/js/tooltips.js' />"></script>
	
<script>
	putUserResources("<c:url value='/resourceList'/>");
	function emptyTopSearchBox() {
		
		document.getElementById("search-input").value = "";
	}
	function viewResource(uid) {
		var newURL = window.location.toString() + "/" + uid;
		window.location = newURL;
	}
	
	function removeContributor(uid) {
		var newURL = window.location.toString() + "/delete?contributor=" + uid;
		window.location = newURL;
	}
	
	function acceptContributor(uid) {
		var newURL = window.location.toString() + "/accept?uid=" + uid;
		window.location = newURL;
	}
	
	function rejectContributor(uid) {
		var newURL = window.location.toString() + "/reject?uid=" + uid;
		window.location = newURL;
	}
</script>
</head>

<body id="www-url-cz">

	<!-- Main -->
	<div id="main" class="box">

		<!-- Header -->
		<div id="header">

			<!-- Logotyp -->
			<img alt="" src="<c:url value='/design/logo.png'/>" class="logo" />
			<hr class="noscreen" />

			<!-- Quick links -->
			<div class="noscreen noprint">
				<p>
					<em>Quick links: <a href="#content">content</a>, <a
						href="#tabs">navigation</a>, <a href="#search">search</a>.</em>
				</p>
				<hr />
			</div>

			<!-- Search -->
			<div id="search" class="noprint">
				<form action="<c:url value='/search/doSearch'/>" method="GET">
					<fieldset>
						<legend>Search</legend>
						<label><span class="noscreen">Find:</span> <span
							id="search-input-out"><input type="text"
								id="search-input" name="search-input" size="30" placeholder="Search Projects" onclick="javascript:emptyTopSearchBox()"/> </span> </label> 
								<input type="image" src="<c:url value='/design/search_submit.gif' />" id="search-submit" ALT="Submit Form" border="0" value=”Submit”/>
					</fieldset>
				</form>
			</div>
			<!-- /search -->

		</div>
		<!-- /header -->

		<!-- Main menu (tabs) -->
		<div id="tabs" class="noprint">

			<h3 class="noscreen">Navigation</h3>
			<ul class="box">
				<li><a href="<c:url value='/announcement'/>">Announcements<span
						class="tab-l"></span><span class="tab-r"></span>
				</a>
				</li>
				<!-- Active -->
				<li id="active"><a href="<c:url value='/myproject'/>">Projects<span
						class="tab-l"></span><span class="tab-r"></span>
				</a>
				</li>
				<li><a href="<c:url value='/search'/>">Search<span
						class="tab-l"></span><span class="tab-r"></span>
				</a>
				</li>
				<li><a href="<c:url value='/rule' />">Rules<span
						class="tab-l"></span><span class="tab-r"></span>
				</a>
				</li>
			</ul>
			
			<div  class="f-right" style="margin-right:20px; margin-bottom:20px; font-weight: bold; color: #FF9000;">
				Hi, ${user.firstName} ${user.lastName} | <a href="<c:url value='/logout' />">Logout</a>
			</div>

			<hr class="noscreen" />
		</div>
		<!-- /tabs -->

		<!-- Page (2 columns) -->
		<div id="page" class="box">
			<div id="page-in" class="box">

				<!-- Content -->
				<div id="content">

					<!-- Article -->
					<div class="article">
						<h2>
							<span>${contributorType} - ${project.name}</span>
						</h2>
							<c:choose>
            				<c:when test="${contributors != null}">
            				<c:forEach var="contributor" items="${contributors}" varStatus="counter">
							<table style="border: hidden">

								<tbody>
								

									<tr>

										<td
											style="padding-top: 8px; border-right: hidden; border-bottom: hidden; padding-left: 10px"><label
											for="fname">First Name:</label>
										</td>

										<td
											style="padding-top: 8px; border-right: hidden; border-bottom: hidden; padding-left: 10px">

											<label>${contributor.firstName}</label></td>
										<td
											style="padding-top: 8px; border-right: hidden; border-bottom: hidden; padding-left: 10px"><label
											for="lname">Last Name:</label>
										</td>

										<td
											style="padding-top: 8px; border-right: hidden; border-bottom: hidden; padding-left: 10px">

											<label>${contributor.lastName}</label>
										</td>

									</tr>
									<tr>

										<td
											style="padding-top: 8px; border-right: hidden; border-bottom: hidden; padding-left: 10px"><label
											for="email">Email:</label>
										</td>

										<td
											style="padding-top: 8px; border-right: hidden; border-bottom: hidden; padding-left: 10px">

											<label><a href="mailto:${contributor.username}">${contributor.username}</a></label></td>

									</tr>
								</tbody>

							</table>
								<!--  
								<td><a href="<c:url value='/myproject/${project.id}/${contributor.id}' />">View Resource</a></td>
                       	 		<td><a href="<c:url value='/myproject/${project.id}/delete?contributor=${contributor.id}' />" >Remove</a>
								-->
								<c:choose>
								<c:when test="${contributorType eq 'Approve Contributors'}">
									<!-- 
									<input class="obutton" type=button onClick="viewResource(${contributor.id})" value='View Resource' />
									<input class="obutton" type=button onClick="removeContributor(${contributor.id})" value='Remove' />
									-->
									<a href="<c:url value='/myproject/${project.id}/${contributor.id}' />"><input type="submit" class="obutton" value="View Resource" /></a>
									<a href="<c:url value='/myproject/${project.id}/delete?contributor=${contributor.id}' />"><input type="submit" class="obutton" value="Remove" /></a>
								</c:when>
								<c:otherwise>
									<!--  
									<input class="obutton" type=button onClick="acceptContributor(${contributor.id})" value='Accept' />
									<input class="obutton" type=button onClick="rejectContributor(${contributor.id})" value='Reject' />
									-->
									<a href="<c:url value='/myproject/${project.id}/pending/accept?uid=${contributor.id}' />"><input type="submit" class="obutton" value="Accept" /></a>
									<a href="<c:url value='/myproject/${project.id}/pending/reject?uid=${contributor.id}' />"><input type="submit" class="obutton" value="Reject" /></a>
								</c:otherwise>
								</c:choose>
							<hr>
							</c:forEach>            				
            				</c:when>
            				</c:choose>
					</div>
					
				</div>
				<!-- /content -->

				<!-- Right column -->
				<div id="col" class="noprint">
					<div id="col-in">

						<hr class="noscreen" />

						<!-- Category -->
						<h3>Contributors</h3>

						<ul id="category">
							<li><a href="<c:url value='/myproject/${project.id}' />">Approved Contributors</a>
							</li>
							<li><a href="<c:url value='/myproject/${project.id}/pending' />">Pending Contributors</a>
							</li>
						</ul>
						
						<hr class="noscreen" />
						
						<h3>Projects</h3>

						<ul id="category">
							<li><a href="<c:url value='/newproject' />">Create Project</a>
							</li>
							<li><a href="<c:url value='/myproject' />">My Projects</a>
							</li>
							<li><a href="<c:url value='/contribute' />">Contributed Projects</a>
							</li>
							<li><a href="<c:url value='/project' />">Other Projects</a>
							</li>
						</ul>

						<hr class="noscreen" />

						<!-- Archive -->
						<h3>
							<span>Latest Resources</span>
						</h3>

						<hr class="noscreen" />

					</div>
					<!-- /col-in -->
				</div>
				<!-- /col -->

			</div>
			<!-- /page-in -->
		</div>
		<!-- /page -->

		<!-- Footer -->
		<div id="footer">
			<div id="top" class="noprint">
				<p>
					<span class="noscreen">Back on top</span> <a href="#header"
						title="Back on top ^">^<span></span>
					</a>
				</p>
			</div>
			<hr class="noscreen" />

			<p id="createdby">
				created by <a href="http://www.nuvio.cz">Nuvio | Webdesign</a>
				<!-- DON´T REMOVE, PLEASE! -->
			</p>
			<p id="copyright">
				&copy; 2012 <a href="mailto:mss.projectbox@gmail.com">ProjectBox Team</a>
			</p>
		</div>
		<!-- /footer -->

	</div>
	<!-- /main -->
	<script type="text/javascript">
// Create the tooltips only on document load
$(document).ready(function() 
{	
	loadToolTips("<c:url value='/dummyUrl'/>");
});
</script>
</body>
</html>